<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>员工列表</title>
<style type="text/css">
	h1{
		text-align: center;
	}
	table{
		border-collapse: collapse;
		width:600px;
		margin: 0 auto;
	}
	th,td{
		border: 1px solid black;
		height: 40px;
		line-height: 40px;
		text-align: center;
	}
	tr:nth-child(odd){
		background-color: #ccc;
	}
	#p1{
		width:600px;
		margin: 0 auto;
		text-align: right;
	}
</style>
</head>
<body>
	<h1>员工列表</h1>
	<p id="p1">
		<a th:href="@{/emp/view}">新增</a>
	</p>
	<table>
		<tr>
			<th>员工编号</th>
			<th>姓名</th>
			<th>性别</th>
			<th>工资</th>
			<th>职位</th>
			<th>操作</th>
		</tr>
		<tr th:each="emp:${empList}">
			<td th:text="${emp.id}">100</td>
			<td th:text="${emp.name}">张三疯</td>
			<td>
				<span th:if="${emp.sex eq 'M'}">男</span>
				<span th:if="${emp.sex eq 'F'}">女</span>
				<span th:if="${emp.sex eq 'O'}">妖</span>
			</td>
			<td th:text="${emp.sal}">10000</td>
			<td th:text="${emp.jobDesc}">太极宗师</td>
			<td>
				<a th:href="@{'/emp/' + ${emp.id}}">修改</a>
				|
				删除
			</td>
		</tr>
	</table>
</body>
</html>